﻿@model Bk.Model.PersonViewModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>个人页面</title>
    <style>
        .main-layout {
            display: flex;
            max-width: 1000px;
            margin: 30px auto 0 auto;
            min-height: 600px;
        }

        .sidebar {
            width: 220px;
            background: white;
            border-radius: 8px;
            padding: 15px 0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            margin-right: 24px;
            flex-shrink: 0;
        }

        .menu-item {
            padding: 12px 20px;
            cursor: pointer;
            transition: all 0.3s;
            color: #666;
        }

            .menu-item:hover {
                background: #f5f5f5;
                color: #333;
            }

            .menu-item.active {
                color: #1890ff;
                background: #e6f7ff;
                border-right: 3px solid #1890ff;
            }

            .menu-item a {
                text-decoration: none;
            }

        .content {
            flex: 1;
            background: white;
            padding: 25px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            min-width: 0;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #666;
            font-weight: bold;
        }

        input, textarea, select {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        textarea {
            height: 100px;
            resize: vertical;
        }

        h2 {
            color: #333;
            border-bottom: 2px solid #eee;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="top-bar">
        <div class="user-info">
            <span class="username">@ViewBag.UserName</span>
        </div>
    </div>
    <div class="main-layout">
        <div class="sidebar">
            <div class="menu-item @(ViewBag.ActiveMenu == "Person" ? "active" : "")" onclick="location.href='@Url.Action("Person", "Home")'">基本信息</div>
            <div class="menu-item @(ViewBag.ActiveMenu == "Uploadface" ? "active" : "")" onclick="location.href='@Url.Action("Uploadface", "Home")'">上传头像</div>
            <div class="menu-item @(ViewBag.ActiveMenu == "Blog" ? "active" : "")" onclick="location.href='@Url.Action("Blog", "Home")'">我的博客</div>
            <div class="menu-item @(ViewBag.ActiveMenu == "ModifyData" ? "active" : "")" onclick="location.href='@Url.Action("ModifyData", "Home")'">修改资料</div>
            <div class="menu-item @(ViewBag.ActiveMenu == "ChangePassword" ? "active" : "")" onclick="location.href='@Url.Action("ChangePassword", "Home")'">修改密码</div>
            <div class="menu-item" onclick="location.href='@Url.Action("index", "Default")'">返回</div>
        </div>

        <div class="content">
            <h2>基本信息</h2>
            <div style="text-align: center; margin-bottom: 20px;">
                <img src="@ViewBag.ImageUrl" alt="头像" style="width: 120px; height: 120px; border-radius: 50%; object-fit: cover;" />
            </div>
            <form>
                <div class="form-group">
                    <label>昵称：</label>
                    <input type="text" value="@Model.NickName" readonly>
                </div>

                <div class="form-group">
                    <label>性别：</label>
                    <select disabled>
                        <option value="">请选择</option>
                        <option value="male" @(Model.Gender == "男" ? "selected" : "")>男</option>
                        <option value="female" @(Model.Gender == "女" ? "selected" : "")>女</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>自我介绍：</label>
                    <textarea readonly>@Model.Introduction</textarea>
                </div>

                <div class="form-group">
                    <label>个人描述：</label>
                    <textarea readonly>@Model.Description</textarea>
                </div>
            </form>
        </div>
    </div>

    <script>
        //上传头像跳转
        function Uploadface() {
            window.location.href = 'Uploadface';
        }
        //我的博客跳转
        function Blog() {
            window.location.href = 'Blog';
        }
        //修改资料跳转
        function ModifyData() {
            window.location.href = 'ModifyData';
        }
        //修改密码跳转
        function ChangePassword() {
            window.location.href = 'ChangePassword';
        }

        document.querySelectorAll('.nav-tab').forEach(tab => {
            tab.addEventListener('click', function () {
                document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
                this.classList.add('active');
            });
        });

        // 侧边栏菜单切换
        document.querySelectorAll('.menu-item').forEach(item => {
            item.addEventListener('click', function () {
                document.querySelectorAll('.menu-item').forEach(i => i.classList.remove('active'));
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>

